﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QiHe
{
    public partial class Task : Form
    {
        DataSet DeptList;

        DataSet EQList;
        public Task()
        {
            InitializeComponent();
           
            MedEQ.Service1 sop = new MedEQ.Service1();
            DeptList = sop.HSP_Department_List(DataTemp.HSPID);

            comboBox1.DataSource = DeptList.Tables[0];
            comboBox1.DisplayMember = "Name";
            comboBox1.ValueMember = "ID";
        }

        private void Task_Load(object sender, EventArgs e)
        {

            MedEQ.Service1 sop = new MedEQ.Service1();
            EQList = sop.Serv_EQ_List_By_Department(comboBox1.SelectedValue.ToString());

            dataGridView1.DataSource = EQList.Tables[0];


        }

        private void comboBox1_Click(object sender, EventArgs e)
        {
            MedEQ.Service1 sop = new MedEQ.Service1();
            EQList = sop.Serv_EQ_List_By_Department(comboBox1.SelectedValue.ToString());

            dataGridView1.DataSource = EQList.Tables[0];
        }

        private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
        {
            MedEQ.Service1 sop = new MedEQ.Service1();
            EQList = sop.Serv_EQ_List_By_Department(comboBox1.SelectedValue.ToString());

            dataGridView1.DataSource = EQList.Tables[0];
        }

        private void button1_Click(object sender, EventArgs e)
        {
            MedEQ.Service1 sop = new MedEQ.Service1();
            string result = sop.Serv_DEL_EQ_By_Flag(EQList.Tables[0].Rows[dataGridView1.CurrentCell.RowIndex][1].ToString());

            MedEQ.Service1 sop4 = new MedEQ.Service1();
            EQList = sop4.Serv_EQ_List_By_Department(comboBox1.SelectedValue.ToString());

            dataGridView1.DataSource = EQList.Tables[0];

           
        }
    }
}
